<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Document</title>
    <script src="angular.js"></script>
</head>
<body ng-app="myApp" ng-controller="myController">
    <input type="text" ng-model="val"> <input type="button" value="点击+1" ng-click="fn()">
    <script>
        var app = angular.module('myApp',[]);
        app.controller('myController',function($scope){
            $scope.fn=function(){
                $scope.val=($scope.val-0)+1;
            };
        });
    </script>
</body>
</html>
